package com.ereach;

import java.util.PriorityQueue;

public class DemoPriorityQueue {
    public static void main(String[] args) {
        PriorityQueue<Integer> nums = new PriorityQueue<>();

        nums.add(800);
        nums.add(700);
        nums.add(600);
        nums.add(500);
        nums.add(400);
        nums.add(300);

        System.out.println(nums);

        System.out.println("===check if the queue is empty");
        System.out.println(nums.isEmpty());

        System.out.println("===remove from the min value");
        while (!nums.isEmpty())
            System.out.println(nums.remove());
    }
}
